About 534 letters

About 3 minutes

#bytes

Description: Type conversion to bytes.

def bytes(x):
    '''
    Type conversion to bytes

    :param x: A variable
    :return: The value of x converted to bytes
    '''

Example:

print(bytes(10))                            # A bytes object of length 10, all values 0
print(bytes('hello', encoding='utf-8'))     # from str

>>> Establishing WebAssembly Runtime.

>>> Standby.

Powered by Shift.

Updated: 6/9/2025

Author: PlanC

Created: 6/9/2025